from gurobipy import *
import gurobipy  as gp
m = gp.Model('Add_Constr')
x = m.addVar(obj=1,vtype = GRB.CONTINUOUS,name="x")
y = m.addVar(obj=1, vtype = GRB.CONTINUOUS,name="y")
z = m.addVar(obj=1, vtype = GRB.CONTINUOUS,name="z")
m.addGenConstrMax(z , [x, y ,3] , name="maxconstr")

m.addGenConstrMin(z , [x, y ,3] , name="z_Min")

m.addGenConstrAbs(x, y, "absconstr") #abs取绝对值

m.addGenConstrAnd(z,[x,y],"andconstr")

m.addRange(x+y+z,5,10,'c')

m.write("CONSTR_TEST.lp")

